home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-09-30 | 2.0 KB | 96 lines | [TEXT/ExPr] |
- * This script creates the standard Apple event to open documents
- * The launch or aesend command can be used here to send the event
- *
- a = "'Init List' 'Add File' '(-' 'Send' 'Launch'"
- lval a,$Control
- menu new,20,0,$Control
- menuscript 20,Control
-
- a = "'Signature' 'Application' 'PPC Browser'"
- lval a,$Target
- menu new,21,0,$Target
- menuscript 21,Target
-
- $TargetSet = 0
- $List = 0
- $sign = '****'
-
- disp 'To use this script select the target using Target menu'
- disp ' The target is specified by selecting one of the following:'
- disp ' an application (used only with launch)'
- disp ' a 4 character application signature (used with launch or send)'
- disp ' a target chosen by PPC Browser (used only with send)'
- disp ' The files to be sent are chosen using "Add File" from the Control menu'
- disp ' This list is initialized by choosing "Init List" from the Control menu'
- disp ' Send the event by choosing "Send" or "Launch" from the Control menu'
-
- script Control
- if #arg(2) = 1
- $List = 0
- else if #arg(2) = 2
- get a
- test (#ret) exit
- inc $List
- alias $List[$List] = ,a
- else
- if $TargetSet = 0
- disp 'No Target'
- exit
- else if $List = 0
- disp 'No Files Selected'
- exit
- else if #arg(2) = 4
- if $TargetSet = 2
- disp 'Cannot use Application target with Send'
- exit
- end
- exec BuildEvent
- aesend
- else
- if $TargetSet = 3
- disp 'Cannot use PPC Browser target with Launch'
- exit
- end
- path x,
- file 0,$Appl
- $sign = #file(cre)
- exec BuildEvent
- if $TargetSet = 1
- launch sign=$sign,aevt
- else
- launch file=$Appl,aevt
- end
- end
- end
-
- script Target
- if #arg(2) = 1
- do
- accept $sign,'Enter 4 character application signature'
- test (#ret) exit
- test (#len($sign) = 4) quit
- end
- else if #arg(2) = 2
- get $Appl,'APPLadrp'
- test (#ret) exit
- path x = ,
- disp 'target application is '#path':'$Appl
- else
- aetarget $Targ
- test (#ret) exit
- end
- $TargetSet = #arg(2)
-
- script BuildEvent
- if $TargetSet = 3
- aenew 'aevt','odoc',targ=$Targ
- else
- aenew 'aevt','odoc',sign=$sign
- end
- aelistnew
- i = 0
- do while i < $List
- inc i
- aelistadd 'alis',$List[i]
- end
- aeadd '----','list'